<?php
    @include_once("./conn.php");

    $user = $_POST["user"];
    

    if(!($user)){
        argErr();
    }


    
    $search = "select count(*) as count from `shoppingcar` where user = '$user'";
    $result = mysqli_query($conn,$search);

    $item = mysqli_fetch_assoc($result);  // 查询的结果

    $obj = array();
    if($item["count"]>0){
        $obj["status"] = true;
        $obj["num"] = $item["count"];
    }else{
        $obj["status"] = false;
        $obj["num"] = 0;
        $obj["sql"] = $sql;
    }
    echo json_encode($obj);
?>